import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Add from '../components/add.vue'
import All from '../components/All.vue'
import Main from '../components/Main.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '',
        name: 'Main',
        component: Main,
        children: [
          {
            path: '',
            name: 'All',
            component: All
          },
          {
            path: '/add',
            name: 'Add',
            component: Add
          }
        ]
      }
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
